<?
require_once("classes/encryption_class.php");

class crypt extends encryption_class {
    var $key = BD_SERVIDOR;
    var $tam = 16;

    function encrypt($plain_text, $key='', $tam='') {
        $this->key = $key !== '' ? $key : $this->key;
        $this->tam = $tam !== '' ? $tam : $this->tam;
        $enc_text = parent::encrypt(preg_replace("/[^[:alnum:]]+/S", "", $this->key), $plain_text, $this->tam);
        return $enc_text;
    }
    function decrypt($enc_text, $key='') {
        $this->key = $key !== '' ? $key : $this->key;
        $plain_text = parent::decrypt(preg_replace("/[^[:alnum:]]+/S", "", $this->key), $enc_text);
        return $plain_text;
    }
}

?>